<template>
  <el-dialog
    append-to-body
    :before-close="beforeClose"
    :visible.sync="show"
    :title="title"
    width="45%"
    @close="close"
    @closed="closed"
  >
    <el-form ref="myForm" label-width="150px" :model="form">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>基础信息</span>
        </div>
        <div>
          <el-row>

            <el-col :span="12">
              <el-form-item label="企业名称">
                {{ form.name }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="工商注册号">
                {{ form.item }}
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="办公地址">
                {{ form.house_address }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="统一社会信用代码">
                {{ form.code }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="财政分片">
                {{ form.region_info.street_name }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="组织机构代码">
                {{ form.item }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="纳税楼宇">
                {{ form.building_info.name }}
              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="统计属地">
                {{ form.region_info.street_name }}
              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="联系人">
                {{ form.legal_person }}
              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="联系电话">
                {{ form.legal_person_mobile }}
              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="行业代码">
                {{ form.item }}
              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="所属6+2产业">
                {{ form.item }}
              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="入库">

                {{ form.item }}

              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="属于6+2产业">
                {{ form.item }}

              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="出租方">
                {{ form.item }}
              </el-form-item></el-col>

          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="大树/小巨人企业">

                {{ form.item }}

              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="属于限上(规上)企业">
                {{ form.item }}

              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="上市/挂牌企业">

                {{ form.item }}

              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="数字经济企业">
                {{ form.item }}

              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="纳税情况">
                纳税
              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="出税情况">
                出税

              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="机关/事业单位" /></el-col>
            <el-col :span="12">
              <el-form-item label="金融企业" /></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="企业人数:">
                {{ form.people_number }}
              </el-form-item></el-col>

          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="备注:">
                <el-input
                  v-model="form.remark"
                  type="textarea"
                  rows="5"
                  maxlength="200"
                  readonly
                  style="border:0"
                />
              </el-form-item>
            </el-col>

          </el-row>
        </div>
      </el-card>
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>企业入驻/虚拟注册信息</span>
        </div>
        <div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="楼宇名称">
                {{ form.building_info.name }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所在街道">
                {{ form.region_info.street_name }}
              </el-form-item>
            </el-col>

          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="入驻时间">
                {{ form.join_time }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="房间面积">
                {{ form.item }}
              </el-form-item></el-col>

          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="办公房间">
                {{ form.item }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="联系人">
                {{ form.legal_person }}
              </el-form-item></el-col>
            <el-col :span="12">
              <el-form-item label="联系电话">
                {{ form.legal_person_mobile }}
              </el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="出租方">
                {{ form.item }}
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="租金">
                {{ form.item }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>

            <el-col :span="12">
              <el-form-item label="租赁到期时间">
                {{ form.expire_time }}

              </el-form-item></el-col>
          </el-row>

        </div>
      </el-card>
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>企业税收信息</span>
        </div>
        <div>
          <el-table
            :data="tableTaxData"
            stripe
            style="width: 100%;"
          >
            <el-table-column
              prop="date"
              label="税收年月"
              width="180"
            />
            <el-table-column
              prop="name"
              label="税号"
            />
            <el-table-column
              prop="address"
              label="财政分片"
              width="180"
            />
            <el-table-column
              prop="address"
              label="当月累计税收总额"
            />
          </el-table>
        </div>
      </el-card>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { ssqOptions, streetOptions, adminOptions } from '@/list/data'

import { companyGet } from '@/api/company'
export default {
  name: 'RoomScan',
  components: { },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'view'
    },
    data: {
      type: Number,
      default: () => {}
    }
  },
  data() {
    return {
      show: false,
      ssqOptions,
      streetOptions,
      adminOptions,
      form: {
      },
      tableTaxData: {}

    }
  },
  computed: {
    title() {
      const text = '企业详情'
      return text
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.show = val
        this.getData()
      }
    }
  },
  mounted() {
    this.show = this.visible
  },
  methods: {
    handleChange(value) {
      console.log(value)
    },

    getData() {
      console.log('获取数据')
      if (this.data > 0) {
        companyGet(this.data).then(res => {
        //   const room_id = []
        //   res.data.rooms.forEach(item => {
        //     room_id.push(item.id)
        //   })
        //   res.data.room_ids = room_id
          this.form = res.data
        })
      }
    },
    handleClose() {
      console.log('点击关闭')
      this.beforeClose()
    },

    beforeClose() {
      console.log('关闭前的回调')
      this.show = false
      this.$emit('update:visible', false)
    },
    close() {
      console.log('关闭的回调')
    },
    closed() {
      console.log('关闭动画结束后的回调')
    }
  }
}
</script>

<style scoped>
</style>
